package com.lxw.study.behavioral.command.case1;

public class Client {
    public static void main(String[] args) {
        LivingRoomLight livingRoomLight = new LivingRoomLight();
        KitchenLight kitchenLight = new KitchenLight();

        LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight);
        LightOffCommand kitchenLightOff = new LightOffCommand(kitchenLight);

        RemoteControl remote = new RemoteControl();

        remote.setCommand(livingRoomLightOn);
        remote.pressButton(); // Living room light is on
        remote.pressUndo();   // Living room light is off

        remote.setCommand(kitchenLightOff);
        remote.pressButton(); // Kitchen light is off
        remote.pressUndo();   // Kitchen light is on
    }
}
